package com.hqyj.pojo;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Setting {
    private Integer sId;

    private Date openOffice;

    private Date endOffice;

    private Integer leave;

    private Integer absenteeism;

    public void setOpenOffice(Date openOffice) {
        this.openOffice = openOffice;
    }

    public void setEndOffice(Date endOffice) {
        this.endOffice = endOffice;
    }

    public Integer getsId() {
        return sId;
    }

    public void setsId(Integer sId) {
        this.sId = sId;
    }

    public String getOpenOffice() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        if(this.openOffice!=null){
            return sdf.format(this.openOffice);
        }
        return "";
    }

   /* public void setOpenOffice(String openOffice) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        if(openOffice!=null){
            this.openOffice = sdf.parse(openOffice);
        }else{
            this.openOffice = new Date();
        }
    }*/

    public String getEndOffice() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        if(this.endOffice!=null){
            return sdf.format(this.endOffice);
        }
        return "";
    }

   /* public void setEndOffice(String endOffice)throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        if(endOffice!=null){
            this.endOffice = sdf.parse(endOffice);
        }else{
            this.endOffice = new Date();
        }
    }*/

    public Integer getLeave() {
        return leave;
    }

    public void setLeave(Integer leave) {
        this.leave = leave;
    }

    public Integer getAbsenteeism() {
        return absenteeism;
    }

    public void setAbsenteeism(Integer absenteeism) {
        this.absenteeism = absenteeism;
    }
}